function start()
require "src/lib.lua"
Import "MainState.lua"
Import "items.lua"
Import "obj/redstone.lua"
Import "obj/scene.lua"
Import "obj/toolbox.lua"
Import "obj/tooltip.lua"

sheet = nil
MainScene = nil
ToolBox = nil

function love.load()
	timer.start(0.00000001,1,function(n)
		print("timer",n)
	end)
	timer.start(1,1,function(n)
		print("timerEnd",n)
		print(#timer.Timers)
	end)
	--PrintTable(love)
	Debug.print()
	
	sheet = graphics.loadImage("resource/redstone.png")
	sheet:setFilter("nearest","nearest")
	
	Resource.Sheet = sheet
	Resource.load()
	
	MainScene = Scene() --make a new scene
	ToolBox = Toolbox() --make a new toolbox
end

function love.update(dt)
	MainState:Update()
end

function love.draw()
	--love.graphics.setColor(255,0,0)
	love.graphics.print("Hello World!", 500,500)
	MainState:Draw()
end

function love.quit()
	print("Closing")
end

--[[ WX LUA CODE
thread = love.thread.newThread("thread", "src/wx.lua")
started = false
function love.keypressed(key, u)
	print(tostring(key),u)
   --Debug
   if key == "`" then --set to whatever key you want to use
		if started then --thread:kill() started = false
		else
			thread:start()
			--thread:send("open",true)
			started = true
		end
		PrintTable(love.thread.getThreads(),true)
   end
   if u == 32 then
   end
end
]]--
end
start()
